package com.zmn.mcc.common.constant;

import com.google.common.collect.Lists;
import com.zmn.common.dictionary.DictModel;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 描述: 菜单常量类
 *
 * @param
 * @return
 * @author guoqiao
 * @since 2021/5/28 18:29
 */
public class MenuConsts {

    /**
     * 描述: 状态：1.停用、2.启用
     */
    public final static int STATUS_STOP_KEY = 1;
    public final static String STATUS_STOP_KEY_STR = "停用";
    public final static int STATUS_START_KEY = 2;
    public final static String SSTATUS_START_KEY_STR = "启用";

    /**
     * 获取状态集合
     */
    public static List<DictModel> listStatus() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(2);
        arrayList.add(new DictModel(STATUS_STOP_KEY, STATUS_STOP_KEY_STR));
        arrayList.add(new DictModel(STATUS_START_KEY, SSTATUS_START_KEY_STR));
        return arrayList;
    }

    /**
     * 描述: 获取状态名称
     */
    public static String getStatusName(int status) {
        switch (status) {
            case STATUS_STOP_KEY:
                return STATUS_STOP_KEY_STR;
            case STATUS_START_KEY:
                return SSTATUS_START_KEY_STR;
            default:
                return "";
        }
    }

    /**
     * 描述: 菜单类型 1.目类 2.菜单
     */
    public final static int MENU_TYPE_WHOLE_KEY = 1;
    public final static String MENU_TYPE_WHOLE_KEY_STR = "目录";
    public final static int MENU_TYPE_MENU_KEY = 2;
    public final static String MENU_TYPE_MENU_KEY_STR = "菜单";

    /**
     * 获取菜单类型集合
     */
    public static List<DictModel> listMenuType() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(2);
        arrayList.add(new DictModel(MENU_TYPE_WHOLE_KEY, MENU_TYPE_WHOLE_KEY_STR));
        arrayList.add(new DictModel(MENU_TYPE_MENU_KEY, MENU_TYPE_MENU_KEY_STR));
        return arrayList;
    }

    /**
     * 描述: 获取菜单类型名称
     */
    public static String getMenuTypeName(int menuType) {
        switch (menuType) {
            case MENU_TYPE_WHOLE_KEY:
                return MENU_TYPE_WHOLE_KEY_STR;
            case MENU_TYPE_MENU_KEY:
                return MENU_TYPE_MENU_KEY_STR;
            default:
                return "";
        }
    }


    /**
     * 描述: 最顶层菜单等级 1.一级
     */
    public final static int MENU_LEVEL_FIRST_LEVEL = 1;
    public final static String MENU_LEVEL_FIRST_LEVEL_STR = "一级";
    /**
     * 描述: 菜单等级增加步长
     */
    public final static int MENU_LEVEL_STEP_SIZE = 1;

    /**
     * 获取菜单等级集合
     */
    public static List<DictModel> listMenuLevel() {
        ArrayList<DictModel> arrayList = Lists.newArrayListWithExpectedSize(2);
        arrayList.add(new DictModel(MENU_LEVEL_FIRST_LEVEL, MENU_LEVEL_FIRST_LEVEL_STR));
        return arrayList;
    }

    /**
     * 描述: 获取菜单等级名称
     */
    public static String getMenuLevel(int menuLevel) {
        switch (menuLevel) {
            case MENU_LEVEL_FIRST_LEVEL:
                return MENU_LEVEL_FIRST_LEVEL_STR;
            default:
                return "";
        }
    }

    /**
     * 描述: 一级目录默认父级id为1
     */
    public final static int MENU_FIRST_LEVEL_PARENT_ID = 1;

}
